package com.shierke.Ume.base

import android.app.Activity
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.shierke.Ume.R
import kotlinx.android.synthetic.main.activity_base.*

/**
 * Create by Ybx
 * on 2020-10-11
 * Desribe:
 */
open class BaseActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        super.setContentView(R.layout.activity_base)


    }


    override fun setContentView(layoutResID: Int) {
        body_stub.layoutResource = layoutResID
        body_stub.inflate()

    }


    fun setActivityBarVisibility(show: Boolean) {

        if (show) {
            activityBar.visibility = View.VISIBLE
        } else {
            activityBar.visibility = View.GONE
        }
    }


    fun setActivityTitleHintText(hint: String) {
        if (!hint.isNullOrEmpty()) {
            titleHint.text = hint
        }
    }


    fun setActivityTitleText(title: String) {
        if (!title.isNullOrEmpty()) {
            activityTitle.text = title
        }
    }

    fun setActivityRightText(title: String) {

        if (!title.isNullOrEmpty()) {
            tvRight.text = title
        }


    }


}